package com.gxdf.extendedcontrols.gxdfclient.components;

import java.util.ArrayList;
import java.util.List;

import com.gxdf.extendedcontrols.gxdfclient.data.ValidationResult;

import android.content.Context;
import android.widget.LinearLayout;
import android.widget.TextView;

public class GxdfConcept extends LinearLayout implements IGxdfItem{
	
	String name;
	TextView title;
	ArrayList<GxdfField> fields;

	public GxdfConcept(Context context) {
		super(context);
		
		title = new TextView(context);
		title.setText(name);
		fields = new ArrayList<GxdfField>();
		this.setOrientation(LinearLayout.VERTICAL);
	}
	
	public void addField(GxdfField f){		
		fields.add(f);
	}
	
	public void drawComponent(){
		
		addView(title);
		
		for(GxdfField f: fields){
			f.drawField();
			addView(f);
		}
		
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void addfield(GxdfField f) {
		fields.add(f);		
	}

	

	@Override
	public List<ValidationResult> getValidationList() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void runValidationRules() {
		// TODO Auto-generated method stub
		
	}

//	@Override
//	public String tojSON() {
//		// TODO Auto-generated method stub
//		return null;
//	}



	@Override
	public boolean isFieldvalid() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public String getValue() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void drawField() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void saveValues() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean isModified() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public List<String> getActualValues() {
		// TODO Auto-generated method stub
		return null;
	}
	
	

}
